home *** CD-ROM | disk | FTP | other *** search
/ Larry Magid's Essential Internet / Larry Magid's Essential Internet (Quarterdeck Corporation)(1995).ISO / qsockpro.qip / WLN.MPS < prev    next >
Text File  |  1995-10-09  |  2KB  |  70 lines

  1. # WLN PPP script
  2. # Copyright 1995 Quarterdeck Corporation
  3. # Authored 5/16/95 Kevin Flick
  4.  
  5. #define the variables we will need
  6.  
  7. STRING username
  8. STRING password
  9. STRING framing
  10. STRING IPAddress
  11.  
  12. # uncomment for debugging
  13. #TRACE ON
  14.  
  15. # reset maximum login timeout.
  16. SetTimeout 90
  17.  
  18. CfgGetValue "Username" username
  19. IF result = 0 THEN
  20.     GetInput "Enter your user name" username
  21.     IF result = 0 THEN
  22.         PRINT "Warning, no username entered"
  23.     ELSE
  24.         PRINT "Username set to ["; username; "]"
  25.     ENDIF
  26. ENDIF
  27.  
  28. # get password from access method
  29. # if the Password field is empty, prompt the user for it.
  30. CfgGetValue "Password" password
  31. IF result = 0 THEN
  32.     GetPassword "Enter your password" password
  33.     IF result = 0 THEN
  34.         PRINT "Warning, no password entered"
  35.     ELSE
  36.         # NOTE: Don't print password.
  37.         PRINT "Password set."
  38.     ENDIF
  39. ENDIF
  40.  
  41. # get framing... PPP or SLIP
  42. CfgGetValue "Framing" framing
  43. IF result = 0 THEN
  44.     ABORT "Cannot get framing (SLIP or PPP) ot of Qdeck.ini.%r"
  45. ENDIF
  46.  
  47. CommWaitFor "ogin:"                 # wait for login prompt
  48. #DELAY 5
  49.     CommSend username               # send user name
  50.     CommSend "%r"                   # send carriage return
  51.  
  52. CommWaitFor "assword"               # wait for password prompt
  53. #DELAY 5
  54.     CommSend password               # send password
  55.     CommSend "%r"                   # send carriage return
  56.  
  57. CommWaitFor "==>"
  58. IF framing = "MPPPP" THEN
  59.     CommSend "ppp%r"
  60. ELSE
  61.     CommSend "slip%r"
  62.     CommReadIPAddr IPAddress
  63.     IF result>0 THEN
  64.         CfgSetValue "IPAddress" IPAddress
  65.         PRINT "%rIP Address set to ["; IPAddress; "]"
  66.     ENDIF
  67. ENDIF
  68.  
  69. END
  70.